﻿using Registro.Compras.Data.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Registro.Compras.Data.Mappings
{
    public class EncabezadoMap : EntityTypeConfiguration<Encabezado>
    {
        public EncabezadoMap()
        {
            //table
            ToTable("Encabezados");

            //pk
            HasKey(t => t.Id);

            //property
            Property(t => t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(t => t.Periodo).IsRequired();
            Property(t => t.Ruc).IsRequired();
            Property(t => t.Razon_Social).IsRequired();
            Property(t => t.Estado).IsRequired();

            

        }
    }
}